package com.hyh.result;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Result<T> {
	
	private String code = "0000";
	
	private String msg  = "ok";
	
	private T datas;
	
	public Result(){
		
	}
	
	public Result(String code, String msg){
		this.code = code;
		this.msg = msg;
	}
	
	public Result(EnumVal errEnum){
		this.code = errEnum.getCode();
		this.msg = errEnum.getMsg();
	}
	
	public Result(T datas) {
		this.datas = datas;
	}
	
	public void setError(EnumVal errEnum){
		this.code = errEnum.getCode();
		this.msg = errEnum.getMsg();
	}
	
}
